package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 批量保存套餐和菜品的关联关系
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 批量删除套餐对应的菜品数据
     * @param ids
     */
    void deleteByIds(List<Long> ids);

    /**
     * 查询套餐id对应的菜品list
     * @param id
     */
    @Select("select *from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> getById(Long id);

    /**
     * 删掉套餐对应的菜品数据
     * @param id
     */
    @Delete("DELETE from setmeal_dish where setmeal_id=id")
    void deleteById(Long id);
}
